package cn.edu.lingnan.controller;


import cn.edu.lingnan.common.JsonResult;
import cn.edu.lingnan.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.server.Session;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 文韬
 * @since 2022-06-24
 */
@Controller
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    //跳转到登录页面
    @GetMapping("/toadminLogin")
    public String toadminLogin(){
        return "backlogin";
    }

    @PostMapping("/adminLogin")
    @ResponseBody
    public JsonResult<Void> adminLogin(String aAccount , String aPassWord, Session session){
        return adminService.adminLogin(aAccount,aPassWord,session);
    }


}

